# 打印99乘法表
# for写
for i in range(1, 10):
    for j in range(1, i + 1):
        print(f'{j} * {i} = {j * i}', end='\t')
    print()

print('--' * 60)

# while写
i = 1
while i <= 9:
    j = 1
    while j <= i:
        print(f'{j} * {i} = {j * i}', end='\t')
        j += 1
    print()
    i += 1
print('--' * 60)
# for写倒3角99乘法表

for i in range(9, 0, -1):
    for j in range(1, i + 1):
        print(f'{j} * {i} = {j * i}', end='\t')
    print()
print('--' * 60)
# while写倒3角99乘法表
i = 9
while i > 0:
    j = 1
    while j <= i:
        print(f'{j} * {i} = {j * i}', end='\t')
        j += 1
    print()
    i -= 1
print('--' * 60)
# 打印'*'正方形
for i in range(5):
    for j in range(5):
        print('*', end=' ')
    print()
